﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SampleLibrary
{
    public static class PayCalculator
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
        public enum PayLevel
        {
            EntryLevel = 20,
            Normal = 35,
            Senior = 50
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible")]
        public static int MaximumHours=100;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "BONUS")]
        public const double BONUS = 0.10;

        //static PayCalculator()
        //{
        //    MaximumHours = 100;
        //}

        public static double ComputePayment(int hours, PayLevel level)
        {
            if (hours > MaximumHours)
            {
                throw new ArgumentOutOfRangeException("hours","Employee works too much");
            }

            return ((int)level * hours);
        }
    }
}
